home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: thinkage.on.ca!atbowler
- From: atbowler@thinkage.on.ca (Alan Bowler)
- Subject: Re: GoTo equivalent in C ??
- Message-ID: <DLE24I.Jur@thinkage.on.ca>
- Sender: news@thinkage.on.ca
- Organization: Thinkage Ltd.
- References: <4d67vm$e5h@masala.cc.uh.edu> <4d8sa6$mqc@news.iag.net> <4de4ae$h6a@masala.cc.uh.edu>
- Date: Thu, 18 Jan 1996 18:02:41 GMT
-
- In article <4de4ae$h6a@masala.cc.uh.edu> sukku@menudo.uh.edu (sukumar) writes:
- >
- >What does everyone do?? I have always been tempted to use goto especially in
- >functions involving a lot of computation and error checking.
- >I have heard people say "People who don't know how to code use GOTO". I was
- >curious to know how guys that say this solve the above problem.
- >
- The people who make such blanket statements about goto's are just
- wrong. Used judiciously, goto's are a valuable part of a programmer's
- tool kit. It is true that any goto/label pair can be replaced with
- some set of if/while/flag-variables but applying this approach
- mechanically results in even worse spaghetti. Back when I was first
- getting into the buisiness (Before the famous "Goto's considered
- harmful" letter), a shop I worked at had a style prohibition against
- switch variables.
-
- One common case where goto's are often the best choice is the
- "ooops, something failed, goto common cleanup code" situation.
-